<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('员工互评列表')" />
</head>
<body class="gray-bg">
  <div class="container-div">
		<div class="row">
      <div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="project:projectComment:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        const editFlag = [[${@permission.hasPermi('project:projectComment:edit')}]];
        const removeFlag = [[${@permission.hasPermi('project:projectComment:remove')}]];
        const datas = [[${@dict.getType('rating_level')}]];
        const prefix = ctx + "project/projectComment";

        $(function() {
            var options = {
              url: prefix + "/list",
              createUrl: prefix + "/add",
              updateUrl: prefix + "/edit/{id}",
              removeUrl: prefix + "/remove",
              showSearch: false,
              showColumns: false,
              showToggle: false,
              modalName: "员工互评",
              columns: [{
              checkbox: true
              },
              {
                field : 'commentId',
                title : '',
                visible: false
              },
              {
                field : 'projectName',
                title : '项目名称'
              },
              {
                field : 'commentUserName',
                title : '评论员工'
              },
              {
                field : 'userName',
                title : '被评员工'
              },
              {
                field : 'rating',
                title : '评分',
                formatter: function (value, row, index) {
                  return $.table.selectDictLabel(datas, value);
                }
              },
              {
                field : 'comments',
                title : '员工评价'
              },
              {
                field : 'createTime',
                title : '评论时间'
              },
              {
                  title: '操作',
                  align: 'center',
                  formatter: function(value, row, index) {
                    var actions = [];
                    actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.commentId + '\')"><i class="fa fa-remove"></i>删除</a>');
                    return actions.join('');
                  }
              }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>